package br.livro.cap6.layouts;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class TelaFrameLayoutWrapContentImg extends Activity{

	private int numDoLayout = 0;
	
	@Override
	public void onCreate(Bundle icicle){
		super.onCreate(icicle);
		getLayout();
		setarLayoutEncontrado();
	}
	
	private void getLayout(){
		Intent it = getIntent();
		if(it != null){
			int numLayout = it.getIntExtra("num",0);
			if(numLayout != 0){
				this.numDoLayout = numLayout;
			}
		}
	}
	
	private void setarLayoutEncontrado(){
		switch(numDoLayout){
			case 1:
				setContentView(R.layout.frame_layout_wrap_content_img);
				break;
			case 2:
				setContentView(R.layout.frame_layout_fill_parent_img_wrap);
				break;
			case 3:
				setContentView(R.layout.frame_layout_fill_parent_img_fill);
				break;
			case 4:
				setContentView(R.layout.linear_layout_horizontal);
				break;
			case 5:
				setContentView(R.layout.linear_layout_vertical);
				break;
			case 6:
				setContentView(R.layout.linear_layout_gravity);
				break;
			case 7:
				setContentView(R.layout.linear_layout_form);
				break;
		}
	}
}
